package grid;
import java.util.HashMap;

import grid.Location;
import object.GridObject;
import object.Tile;
import object.Actor;

public class Grid {
	// grid uses format [x][y]
GridObject[][] objects;

HashMap<Location, Actor> actors;

public Grid(){
	this(10);
}

public Grid(int size){
	this(size, size);
}

public Grid(int width, int height){
	objects=new Tile[width][height];
	actors = new HashMap<Location, Actor>();
}

public void remove(int x, int y){
	objects[x][y]=null;
}
public void removeActor(int x, int y){
	Location loc = new Location(x, y);
	if(actors.get(loc) != null){
		actors.remove(loc);
	}
}
public void add(GridObject obj, int x, int y){
	objects[x][y]=obj;
}
public void add(Actor actor, int x, int y){
	Location loc = new Location(x, y);
	actors.put(loc, actor);
}
public GridObject getTile(int x, int y){
	return objects[x][y];
}
public Actor getActor(int x, int y){
	Location loc = new Location(x, y);
	return actors.get(loc);
}

//incomplete
public void move(int x, int y){

	
}
}
